<template>
    <van-nav-bar
      title="用户中心"
      left-text="返回"
      right-text="退出"
      left-arrow
      @click-left="$router.back()"
      @click-right="userQuite"
    />
    <van-cell-group title="个人中心" inset>
      <van-image
      position="right"
      round
      width="40px"
      height="40px"
      src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
/>
      <van-cell title="修改密码" is-link to="index" />
      <van-cell title="地址管理" is-link to="index" />
      <van-cell title="订单中心" is-link to="index" />
    </van-cell-group>
  </template>
  
  <script setup lang="ts">
  import { ref } from "vue";
  import { useUserInfoStore } from "@/stores/userInfo";
  import { useRouter } from "vue-router";
  import { showSuccessToast } from "vant";
  
  const store = useUserInfoStore();
  const router = useRouter();
  
  const userQuite = () => {
    store.setUserToken("");
    localStorage.setItem("userToken", "");
    router.push("/");
    showSuccessToast("退出成功");
  };
  </script>
  
  <style></style>
  